<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>3-Math随机点名</title>
	</head>
	<body>
		<script type="text/javascript">
		function p(min,max){
			return Math.floor(Math.random()*(max-min)+1)+min;
		}
		console.log(p(1,10))
		//随机点名
			var arr = ['张杰','沈腾','贾玲','肖战','杨紫'];
			console.log(arr[p(0,4)]);
		</script>
	</body>
</html>
